<div class="material">
    <form class="w5c-form demo-form"  w5c-form-validate name="material">
        <div class="title" style="width: 100%">
            <span class="jump-color" ui-sref="main.contractManagement">合约管理 </span>
            <span class="tit-color"> / 新建合约</span>
        </div>
        <div class="info">
            <div class="authentication">
                <div class="tit">
                    基本信息
                </div>
                <div class="bottom">
                    <ul class="cp">
                        <li class="form-group">
                            <span><label class="control-label"><i class="red-icon">*</i>帐户名：</label></span>
                            <span class=" choose_CP" ng-click="chooseCP()" style="margin-left: 0">选择CP</span>
                            <input type="number" name="choose_CP" hidden ng-model="data.cpProperty" required="" w5c-dynamic-element>

                            <div ng-if="deleteSelect==true" style="margin-left: 124px;margin-top:10px">
                                <label  ng-if="data.cpProperty == 13 ||data.cpProperty == 12">
                                    <span>{{data.userName}}</span>
                                    <i class="fa fa-times fa_del" aria-hidden="true" ng-click="deleteSelectCP()"></i>
                                </label>
                            </div>
                        </li>
                        <li ng-if="deleteSelect==true">
                            <span>昵称：</span>
                            <span>{{data.nickName}}</span>
                        </li>
                        <li ng-if="deleteSelect==true">
                            <span>CP性质：</span>
                            <span>{{table[data.cpType]}}</span>
                        </li>
                        <li ng-if="deleteSelect==true">
                            <span>CP类型：</span>
                            <span>{{table[data.cpProperty]}}</span>
                        </li>
                        <li ng-if="data.cpProperty == 13 && deleteSelect==true">
                            <span>机构名称：</span>
                            <span>{{data.realName}}</span>
                        </li>
                        <li ng-if="data.cpProperty == 12 && deleteSelect==true">
                            <span>真实姓名：</span>
                            <span>{{data.realName}}</span>
                        </li>

                    </ul>
                </div>

            </div>
            <div class="balance">
                <div class="tit">
                    合约内容
                </div>
                <div class="bottom">
                    <ul>
                        <li  class="form-group">
                            <span>甲方名称：</span>
                            <select  ng-model="formData.partyA"  class="personal-select select" ng-init="formData.partyA='600'">
                                <option value="600"  ng-selected="data.partyA==600">北京东方视角文化传媒股份有限公司</option>
                            </select>
                        </li>
                        <li  class="form-group">
                           <span> <label  class="control-label"><i class="red-icon">*</i>甲方签署人：</label></span>
                            <input style="margin-left: -4px" type="text" ng-model="formData.signerA" class="contract_input"
                                   name="signerA" required="" ng-minlength="2" ng-maxlength="20" w5c-dynamic-element>
                        </li>

                        <li  class="form-group">
                            <span>乙方名称：</span>
                            <span>{{data.realName}}</span>
                        </li>
                        <li  class="form-group">
                            <span><label  class="control-label"><i class="red-icon">*</i>乙方签署人：</label></span>
                            <input style="margin-left: -4px" type="text" class="contract_input"  ng-model="formData.signerB"
                                   name="signerB" required="" ng-minlength="2" ng-maxlength="20" w5c-dynamic-element>
                        </li>
                        <li  class="form-group">
                            <span><label  class="control-label"><i class="red-icon">*</i>签署日期：</label></span>
                            <p  style="display: inline-block;position: relative;">
                                <input type="text" style="width: 209px" uib-datepicker-popup="yyyy-MM-dd" ng-model="time" name="time" required
                                       show-weeks="false" is-open="item.openedStart" datepicker-options="item.startDateOpt" close-text="关闭"
                                           clear-text="清除" current-text="今天" placeholder="签署日期" readonly class="date_time">
                                <span class="input-group-btn calendar_button">
                                    <button type="button" class="btn btn-default" ng-click="openStart(item)">
                                        <i class="glyphicon glyphicon-calendar"></i>
                                    </button>
                                </span>
                            </p>
                            <input type="hidden" name="time1" required="" ng-model="time">
                        </li>
                        <li  class="form-group">
                            <span><label  class="control-label"><i class="red-icon">*</i>合约有效期：</label></span>
                            <div style="display: inline-block">
                                <input ims-select-range-time="rangeDate" type="text" ng-model="aaa">
                                <input ng-model="formData.startDate" required name="rangeDate" type="hidden">
                            </div>
                        </li>
                        <li  class="form-group">
                            <span style="float: left">备注：</span>
                            <textarea  ng-model="formData.memo" name="memo" ng-maxlength="400" w5c-dynamic-element style='padding:4px;'> </textarea>
                        </li>
                        <li  class="form-group sc">
                            <span style="float: left"><label  class="control-label"><i class="red-icon">*</i>合约文件：</label></span>
                            <div style="display: inline-block;">
                                <i class="fa fa-file-pdf-o adobe"  aria-hidden="true" ng-show="picLoading"></i>
                                <label>
                                    <span class="choose_CP" style="margin-left: 0">上传</span>
                                    <input type="file" id="contractLoad"  nv-file-select  uploader="contract" style="display: none">
                                </label>

                                <a  ng-show="picLoading" target=_blank ng-href="{{formData.fileUrl}}">点击预览</a>
                                <div style="color: red">{{imageMsg}}</div>
                                <div ng-show="imageMsg_a==false">
                                    <input type="number" name="contractFile" hidden ng-model="formData.fileUrl.length" required="">
                                </div>
                            </div>
                        </li>
                        <li>
                            <div style="width: 40px;height: 40px;margin-left:110px ">
                                <img  width="100%" height="100%" ng-show="contractLoading" class="loading_pic" src="image/load.gif">
                            </div>

                        </li>
                    </ul>
                </div>
            </div>

            <div class="auditing">
                <div class="text-center">
                    <span class="btn btn-primary" style="width: 90px" w5c-form-submit="submit()" >提交</span>
                    <span class="btn ims-btn" style="width: 90px" ng-click="cancel()" >取消</span>
                </div>
            </div>
            <div style="height: 30px"></div>
        </div>
    </form>

</div>
<script type="text/ng-template" id="chooseCP.html">
    <div class="modal-header">
        <button type="button" class="close" ng-click="cancel()"><span>&times;</span></button>
        <span class="modal-title">选择CP</span>
        <br>
        <label ng-repeat="cp in selectCPs"
               style="width: 100px;margin:5px 5px;padding:5px 10px;background-color: gainsboro">
            <span>{{cp.nickName}}</span><i class="fa fa-times" aria-hidden="true" style="float: right"
                                           ng-click="deleteSelectCP($index)"></i>
        </label>
    </div>
    <div class="modal-body reset-password">
        <div class="CP_head">
            <div class="CP_head">
                <div class="CP_search">
                    <div class="form-group searchLump search-condition">
                        <div class="search-select">
                            <select ng-model="search.key"
                                    ng-options="fileName.key  as fileName.value for fileName in fileNames"></select>
                            <input type="text" class="input width-150"  ng-model="search.value" style="padding-bottom: 1px;margin-left: 15px"   ui-event="{ keyup : 'searchClick($event)' }">
                            <input type="button" class="btn btn-primary" value="搜索" style="margin:-2px 0 0 20px" ng-click="searchClick()">

                        </div>
                    </div>
                    <div class="search-select">
                        <select  ng-model="search.cplevel" ng-change="selectChange()">
                            <option value="">CP级别</option>
                            <option value="{{level.key}}" ng-repeat="level in levels">{{level.value}}</option>
                        </select>

                        <select  ng-model="search.cpType" ng-change="selectChange()" ng-init="search.cpType='0'" style="margin-left: 15px" >
                            <option value="0">CP类型</option>
                            <option value="{{cpType.key}}" ng-repeat="cpType in cpTypes">{{cpType.value}}</option>
                        </select>
                       <!-- <select  ng-model="search.coopType" ng-init="search.coopType==0" ng-change="selectChange()">
                            <option value="">合作方式</option>
                            <option value="{{sign.key}}" ng-repeat="sign in signs" >{{sign.value}}</option>
                        </select>-->
                    </div>
                </div>
            </div>

        </div>
        <table class="table table-bordered table-hover table-page">
            <thead>
            <tr>
                <th>CP_ID</th>
                <th>昵称</th>
                <th>账户名</th>
                <th>CP级别</th>
                <th>CP性质</th>
                <th>CP类型</th>
            </tr>
            </thead>
            <tbody>
            <tr ng-repeat="CPExamine in CPExamine" ng-click="CPExamineCheck(CPExamine)" style="cursor: pointer">
                <td>
                    {{CPExamine.cpId}}
                </td>
                <td>
                    {{CPExamine.nickName}}
                </td>
                <td>
                    {{CPExamine.userName}}
                </td>
                <td>
                    {{table[CPExamine.cplevel]}}
                </td>
                <td>
                    {{table[CPExamine.cpProperty]}}
                </td>
                <td>
                    {{table[CPExamine.cpType]}}
                </td>
            </tr>
            </tbody>
        </table>
    </div>
    <div class="paging">
        <s-pagination conf="paginationConf"></s-pagination>
    </div>


</script>